<template>
  <van-nav-bar title="设置" @click-left="onClickLeft" fixed>
    <template #left>
      <van-icon name="arrow-left" size="24" color="#000" />
    </template>
  </van-nav-bar>
  <div class="setting-container">
    <div class="exit-button">
      <van-button
        type="primary"
        block
        color="linear-gradient(135deg, #464b50, #14191e)"
        @click="logOut"
      >退出登录</van-button>
    </div>
  </div>
</template>

<script setup>
import router from '../../route';

import { Toast } from 'vant';
const logOut = () => {
  window.sessionStorage.clear();
  Toast.success('退出登录成功')
  setTimeout(() => {
    router.push('./profile')
  }, 500);
}

const onClickLeft = () => {
  history.back()
}
</script>

<style scoped>
.setting-container {
  padding-top: 46px;
  padding-bottom: 50px;
}

.exit-button {
  padding: 12px;
}
</style>
